<?php
require "conf.php";
require "utils/HTTPRequest.php";
require_once "data/dao/ExternalClicksDAO.php";

class External{
	
	private $externalUrl;
	private $gameId;
	
	public function External(){
		
		$this->externalUrl = HTTPRequest::getParam("url");
		$this->gameId = HTTPRequest::getParam("game-id");
			
		$ecdao = new ExternalClicksDAO();
		$ecdao->recordClick($this->externalUrl, $this->gameId);

		header("Location: " . $this->externalUrl);
	}
}
$e = new External();
?>